import request from '@/utils/request'
/*
*获取频道列表
*/
export const channelsList = () => request({
  url: '/v1_0/user/channels'
})

/**
 * 获取所有频道
 */
export const getAllChannels = () => {
  return request({
    method: 'GET',
    url: '/v1_0/channels'
  })
}

export const addUserChannels = obj => {
  return request({
    method: 'patch',
    url: '/v1_0/user/channels',
    data: {
      channels: [obj]
    }
  })
}

/**
 * 删除用户频道
 */
export const deleteUserChannel = channelId => {
  return request({
    method: 'DELETE',
    url: `/v1_0/user/channels/${channelId}`
  })
}
